"use strict";
class Person {
    constructor(username, age) {
        this.username = username;
        this.age = age;
    }
    getInfo() {
        return `${this.username},${this.age}`;
    }
    setName(username) {
        this.username = username;
    }
}
let p1 = new Person('zs', 18);
console.log(p1.getInfo());
console.log(p1.username);
//继承
class Student extends Person {
    constructor(username, age) {
        super(username, age);
    }
    learn() {
        console.log(`${this.age}开始学习`);
        console.log(this.username);
    }
}
let s1 = new Student('lili', 10);
console.log(s1.getInfo());
//访问修饰符
//public:公共的（默认）  在自己类内和子级类内  类外可以访问 
//protected :受保护的  在自己类内和子级类内可以访问 类外不可以访问
//private:  只能在自己的类内访问，子类和类外都不能访问
